package com.ziytek.web.citizen.enums;

import com.ziytek.web.citizen.service.itf.StepAddResponse;
import lombok.Getter;

/**
 * @author fenghx
 * @version 1.0
 * @className StepEnum
 * Description:
 * @date 2024/3/15 13:24
 */
@Getter
public enum StepTypeEnum implements StepAddResponse {
    /**
     * Description: 工步类型信息
     */
    // 工步操作类型 00-充电-01-放电 02-分容灯控显示 03-主动查询数据 04-设置工程参数
    STEP_OPERA_CHARGE("00", "充电"),
    STEP_OPERA_DISCHARGE("01", "放电"),
    STEP_OPERA_LIGHT_CONTROL("02", "分容灯控显示"),
    STEP_OPERA_QUERY_DATA("03", "主动查询数据"),
    STEP_OPERA_SETTING("04", "设置工程参数"),
   // STEP_OPERA_CPD("04", "设置工程参数"),
   // STEP_OPERA_CRD("04", "设置工程参数"),

    OTHER("100", "其他");

    private final String code;
    private final String desc;

    StepTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    @Override
    public String getMsg(String code) {
        for (StepTypeEnum sp : StepTypeEnum.values()) {
            if (sp.getCode().equalsIgnoreCase(code)) {
                return sp.desc;
            }
        }
        return OTHER.getDesc();
    }

    @Override
    public int getPosition(String code) {
        return 0;
    }

    @Override
    public String getCode(String line, int position) {
        return null;
    }
}
